package com.hemaapp.yjnh.bean;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

import com.android.uu.utils.uuUtils;

import xtom.frame.XtomObject;
import xtom.frame.exception.DataParseException;

/**土地作物详细信息
 * 
 */
public class LandGoodsInfo extends XtomObject implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private String id;//	主键id	 
	private String land_id;//所属土地id
	private String good_name;//	作物名称 
	private String price;//	作物定制价格
	private String expect_senddate;//	作物定制发货时间 
	private String regdate;//	发布时间
	private boolean isFirst = false;//判断是否是第一个作物，是的话就显示添加新作物的加号
	private boolean isChecked = false;
	
	public LandGoodsInfo() {
	}
	
	public LandGoodsInfo(JSONObject jsonObject) throws DataParseException {
		if (jsonObject != null) {
			try {
				id = get(jsonObject, "id");
				land_id = get(jsonObject, "land_id");
				good_name = get(jsonObject, "good_name");
				price = uuUtils.formatAfterDot2(get(jsonObject, "price"));
				expect_senddate = get(jsonObject, "expect_senddate");
				regdate = get(jsonObject, "regdate");
				log_i(toString());
			} catch (JSONException e) {
				throw new DataParseException(e);
			}
		}
	}
	
	@Override
	public String toString() {
		return "Order [id=" + id + ", land_id=" + land_id + ", good_name=" + good_name +
				", price=" + price + ", expect_senddate=" + expect_senddate + 
				", regdate=" + regdate + "]";
	}

	/**
	 * @return the id
	 */
	public String getId() {
		return id;
	}

	public String getland_id() {
		return land_id;
	}

	public String getgood_name() {
		return good_name;
	}
	
	public void setCropName(String name) {
		this.good_name = name;
	}

	public String getprice() {
		return price;
	}
	
	public void setPrice(String price) {
		this.price = price;
	}

	public String getexpect_senddate() {
		return expect_senddate;
	}
	
	public void setSenddate(String date) {
		this.expect_senddate = date;
	}

	public String getregdate() {
		return regdate;
	}

	public void setgood_name(String good_name) {
		this.good_name = good_name;
	}

	public void setprice(String price) {
		this.price = price;
	}

	public void setexpect_senddate(String expect_senddate) {
		this.expect_senddate = expect_senddate;
	}
	
	public void setFirst(boolean first) {
		this.isFirst = first;
	}
	
	public boolean getIsFirst() {
		return isFirst;
	}
	
	public boolean getChecked() {
		return isChecked;
	}
	
	public void setChecked(boolean check) {
		this.isChecked = check;
	}
}
